import Vue from 'vue';
import App from './App.vue';
import Vant from 'vant';
import VueRouter from 'vue-router';
import routes from '@/router';
import { Field } from 'vant';
import { Icon } from 'vant';
import moment from 'moment';
// import { NavBar } from 'vant';
import { Tab, Tabs } from 'vant';
import Vuex from 'vuex';
import { Search } from 'vant';
import storeConfig from '@/store';
import NavBar from '@/components/Navbar/';
import ArticleList from '@/components/article-list';

import 'vant/lib/index.css';
// import 'vant/lib/index.css';


Vue.component('NavBar', NavBar);
Vue.component('ArticleList', ArticleList);

Vue.use(Vuex);

// 搜索框
Vue.use(Search);
// Tab 标签页
Vue.use(Tab);
Vue.use(Tabs);
// 全局设置moment语言
moment.locale('zh-cn');

// console.log(moment(1658482134742).fromNow()); // 1小时前

// NavBar 导航栏
Vue.use(NavBar);
// Icon 图标
Vue.use(Icon);
// 输入框
Vue.use(Field);
// 路由
Vue.use(VueRouter);
// 全局注册Vant组件
Vue.use(Vant);

Vue.config.productionTip = false;

new Vue({
  // 挂载路由
  router: new VueRouter({
    routes,
  }),

  // 挂载 store
  store: new Vuex.Store(storeConfig),

  render: (h) => h(App),
}).$mount('#app');
